package com.作业.Day9;

import java.util.Scanner;

public class Homework1 {
    public static void main(String[] args) {
        System.out.println("***欢迎进入注册系统***");
        System.out.println();
        Scanner scanner = new Scanner(System.in);
        while(true){
            int a=1;
            System.out.print("请输入用户名");
            String userName = scanner.next();
            System.out.print("请输入密码");
            String password = scanner.next();
            System.out.print("请再次输入密码");
            String newPassword = scanner.next();
            if(userName.length()<3){
                System.out.println("用户名密码不小于3");
            }
            else
                a++;
            if(password.length()<6){
                System.out.println("密码长度不能小于6");
            }
            else
                 a++;
            if(!password.equals(newPassword)){
                System.out.println("两次输入的密码不相同！");
            }else
                a++;
                   if(a==4){
                       System.out.println("注册成功！请牢记用户名和密码");
                       break;
                   }
                }
            }

}
